#include <iostream>

using namespace std;

const int maxNum = 1 << 10;
int chess[maxNum][maxNum];
int number;

void chessBoard(int row, int column, int x, int y, int siz) {
    // 递归出口
    if(siz == 1) {
        return;
    }

    int s = siz / 2;
    int t = ++number;
    int centerRow = row + s;
    int centerColumn = column + s;
    if(x < centerRow && y < centerColumn) {
        chessBoard(row, column, x, y, s);
    } else {
        chess[centerRow - 1][centerColumn - 1] = t;
        chessBoard(row, column, centerRow - 1, centerColumn - 1, s);
    }


    if(x < centerRow && y >= centerColumn) {
        chessBoard(row, centerColumn, x, y, s);
    } else {
        chess[centerRow - 1][centerColumn] = t;
        chessBoard(row, centerColumn, centerRow - 1, centerColumn, s);
    }
    if(x >= centerRow && y < centerColumn) {
        chessBoard(centerRow, column, x, y, s);
    } else {
        chess[centerRow][centerColumn - 1] = t;
        chessBoard(centerRow, column, centerRow, centerColumn - 1, s);
    }

    if(x >= centerRow && y >= centerColumn) {
        chessBoard(centerRow, centerColumn, x, y, s);
    } else {
        chess[centerRow][centerColumn] = t;
        chessBoard(centerRow, centerColumn, centerRow, centerColumn, s);
    }

}

int main() {
    	int siz, x, y;
        cin >> siz >> x >> y;
        chess[x][y] = number = 1;

        chessBoard(0, 0, x, y, siz);

        for(int i = 0; i < siz; i++) {
            for(int j = 0; j < siz; j++) {
                cout << chess[i][j] << "\t";
            }
            cout << endl;
        }


    return 0;
}